def input_score():
    while True:
        try:
            score = int(input('请输入成绩:'))
        except Exception as e:
            print('输入错误')
            continue
        if 1 <= score <= 100:
            return score
        else:
            print('输入的成绩不在1~100范围内')


print(input_score())
